﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Register TagPrefix="wssuc" TagName="ButtonSection" Src="/_controltemplates/ButtonSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormSection" Src="/_controltemplates/InputFormSection.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="InputFormControl" Src="/_controltemplates/InputFormControl.ascx" %>
<%@ Register TagPrefix="ctr" TagName="formula" Src="~/_controltemplates/Validation.sp2010/FormulaText.ascx" %>
<%@ Register TagPrefix="ctr" TagName="GetUser" Src="~/_controltemplates/Validation.sp2010/GetUser.ascx" %>


<%@ Page Language="C#"
    DynamicMasterPageFile="~masterurl/default.master"
    AutoEventWireup="true"
    Inherits="Validation.sp2010.WorkFlow.ValidationWorkflow.Rules"
    CodeBehind="Rules.aspx.cs" %>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <style type="text/css">
        .ms-formbody {
            background-color: #f6f6f6;
        }

        .btn_link {
            margin-left: 10px;
            margin-top: 3px;
            margin-bottom: 3px;
        }
    </style>

    <script type="text/javascript" src="../../jquery-1.8.2.min.js" />
    <script type="text/javascript">
        function confirmDelete() {
            var confirmMessage = 'Suppression';
            var r = confirm(confirmMessage);
            return (r == true);
        }
    </script>

    <asp:Label ID="ErrorFeatureLabel" runat="server" Text="<%$Resources:vwf,error_web_feature%>" ForeColor="Red" Visible="false"></asp:Label><br />
    <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <asp:Repeater ID="RepeaterSteps" OnItemCommand="RepeaterSteps_ItemCommand" runat="server">
                    <HeaderTemplate>
                        <table width="100%" cellpadding="0" cellspacing="5" border="0" id="onetidMngCytpeRptrTable">
                            <colgroup>
                                <col width="10%" />
                                <col width="10%" />

                                <col width="10%" />
                                <col width="10%" />

                                <col width="50%" />
                                <col width="10%" />

                            </colgroup>
                            <tr>
                                <th scope="col" class="ms-vh2-nofilter">
                                    <h3>
                                        <asp:Literal ID="Literal3" runat="server" Text="<%$Resources:vwf,label_sequence%>" /></h3>
                                </th>
                                <th scope="col" class="ms-vh2-nofilter">
                                    <h3>
                                        <asp:Literal ID="Literal4" runat="server" Text="<%$Resources:vwf,label_title_step%>" /></h3>
                                </th>
                                <th scope="col" class="ms-vh2-nofilter">
                                    <h3>
                                        <asp:Literal ID="Literal12" runat="server" Text="<%$Resources:vwf,label_type_step%>" /></h3>
                                </th>
                                <th scope="col" class="ms-vh2-nofilter">
                                    <h3>
                                        <asp:Literal ID="Literal5" runat="server" Text="<%$Resources:vwf,label_actor%>" /></h3>
                                </th>
                                <th scope="col" class="ms-vh2-nofilter">
                                    <h3>
                                        <asp:Literal ID="Literal6" runat="server" Text="<%$Resources:vwf,label_detail%>" /></h3>
                                </th>
                                <th></th>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <!--Order-->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <%# Container.ItemIndex+1 %>
                            </td>

                            <!--Title-->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <%# Eval("Title") %>
                            </td>
                            <!--Type-->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <%# Eval("Type") %>
                            </td>

                            <!--Actor-->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <%# Eval("Actor") %>
                            </td>

                            <!--Details-->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <%# Eval("Details") %>
                            </td>
                            <!--Delete -->
                            <td valign="top" scope="col" class="ms-vh2-nofilter">
                                <asp:LinkButton ID="LinkButton1" OnClientClick="return confirmDelete();" runat="server">
                                    <asp:Literal ID="Literal7" runat="server" Text="<%$Resources:wss,AclEditor_RemoveUserButton%>" />
                                </asp:LinkButton>

                            </td>

                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </td>
        </tr>
        <tr>
            <div id="AddItemBloc">
                <table cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td>
                            <p style="text-align: right">

                                <asp:LinkButton CssClass="btn_link" OnClick="newTaskStep_Click" ID="newTaskStep" runat="server">
                                    <asp:Literal runat="server" Text="<%$Resources:vwf,label_new_step_task %>" />
                                </asp:LinkButton>
                                <asp:LinkButton CssClass="btn_link" OnClick="newMailStep_Click" ID="newMailStep" runat="server">
                                    <asp:Literal  runat="server" Text="<%$Resources:vwf,label_new_step_mail %>" />
                                </asp:LinkButton>
                            </p>
                        </td>
                    </tr>
                    <tr>

                        <asp:MultiView runat="server" ID="TabNewStep" ActiveViewIndex="0">
                            <asp:View runat="server">
                                <h3><asp:Literal ID="Literal2"  runat="server" Text="<%$Resources:vwf,label_new_step_task_title %>" /></h3>
                                <table class="propertysheet" border="0" width="100%" cellspacing="0" cellpadding="0">
                                    <colgroup>
                                        <col width="30%" />
                                        <col width="70%" />
                                    </colgroup>
                                    <!--Title-->

                                    <wssuc:InputFormSection ID="InputFormSection1" runat="server" Title="<%$Resources:vwf,label_title_step %>" Description="<%$Resources:vwf,label_title_step_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
                 <asp:TextBox ID="TextBox_TitleStep_Task" runat="server"></asp:TextBox>
                                                <asp:RequiredFieldValidator ControlToValidate="TextBox_TitleStep_Task" ValidationGroup="createTaskGroup" ID="RequiredFieldValidator1" runat="server" ErrorMessage="<%$Resources:vwf,error_required %>"></asp:RequiredFieldValidator>
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Actor-->
                                    <wssuc:InputFormSection ID="InputFormSection2" runat="server" Title="<%$Resources:vwf,label_actor_task %>" Description="<%$Resources:vwf,label_actor_task_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
                           <ctr:GetUser runat="server" EnableGroup="True" MultiSelect="False" ID="Actor_Task" WithSecondaryValue="True" />
                                               
                         
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Title Task-->

                                    <wssuc:InputFormSection ID="InputFormSection3" runat="server" Title="<%$Resources:vwf,label_title_task %>" Description="<%$Resources:vwf,label_title_task_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
    <ctr:Formula runat="server" ID="TextBox_Title_Task" />
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Description Task-->

                                    <wssuc:InputFormSection ID="InputFormSection4" runat="server" Title="<%$Resources:vwf,label_desc_task %>" Description="<%$Resources:vwf,label_desc_task_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
                 <ctr:Formula runat="server" ID="TextBox_Desc_Task" />
                                   
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--With Extension-->
                                    <wssuc:InputFormSection ID="InputFormSection5" runat="server" Title="<%$Resources:vwf,label_extension %>" Description="<%$Resources:vwf,label_extension_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
     <asp:DropDownList ID="DropDown_Extension_Task" runat="server">
                                                    <asp:ListItem Value="1" Selected="True" Text="<%$Resources:wss,Yes %>" />
                                                    <asp:ListItem Value="2" Text="<%$Resources:wss,No %>" />
                                                </asp:DropDownList>
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Force validation-->
                                    <wssuc:InputFormSection ID="InputFormSection6" runat="server" Title="<%$Resources:vwf,label_force_validation%>" Description="<%$Resources:vwf,label_force_validation_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
     <asp:DropDownList ID="DropDown_ForceValidation" runat="server">
                                                    <asp:ListItem Value="1"  Text="<%$Resources:wss,Yes %>" />
                                                    <asp:ListItem Value="2" Selected="True" Text="<%$Resources:wss,No %>" />
                                                </asp:DropDownList>
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <wssuc:ButtonSection runat="server" ShowStandardCancelButton="false">
                                        <template_buttons>
                                                                <asp:PlaceHolder ID="PlaceHolder2" runat="server">               
                                                                  
                                                             <asp:Button OnClick="CreateTaskStep_Click"  ValidationGroup="createTaskGroup" ID="AddTaskStep" runat="server" class="ms-ButtonHeightWidth" Text="<%$Resources:wss,multipages_okbutton_text %>" />
                                                                </asp:PlaceHolder>
                                                             </template_buttons>
                                    </wssuc:ButtonSection>

                                </table>
                            </asp:View>

                            <asp:View runat="server">
                                <h3><asp:Literal ID="Literal1"  runat="server" Text="<%$Resources:vwf,label_new_step_mail_title %>" /></h3>
                                <table class="propertysheet" border="0" width="100%" cellspacing="0" cellpadding="0">

                                    <colgroup>
                                        <col width="30%" />
                                        <col width="70%" />
                                    </colgroup>
                                    <!--Title-->

                                    <wssuc:InputFormSection ID="InputFormSection7" runat="server" Title="<%$Resources:vwf,label_title_step %>" Description="<%$Resources:vwf,label_title_step_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
               <asp:TextBox ID="TextBox_Mail_Title" runat="server"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ControlToValidate="TextBox_Mail_Title" ValidationGroup="CreateMailGroup" ID="RequiredFieldValidator2" runat="server" ErrorMessage="<%$Resources:vwf,error_required %>"></asp:RequiredFieldValidator>
                                             
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>


                                    <!--Actor-->
                                    <wssuc:InputFormSection ID="InputFormSection8" runat="server" Title="<%$Resources:vwf,label_to_mail %>" Description="<%$Resources:vwf,label_to_mail_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>   
                                                            <ctr:GetUser runat="server" EnableGroup="False" MultiSelect="True" ID="Mail_Actor" WithSecondaryValue="False" />
                                                       
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Mail cc-->

                                    <wssuc:InputFormSection ID="InputFormSection9" runat="server" Title="<%$Resources:vwf,label_cc_mail %>" Description="<%$Resources:vwf,label_cc_mail_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>      
                                                            <ctr:GetUser EnableGroup="False" runat="server" MultiSelect="True" ID="Mail_CC"   WithSecondaryValue="False" />
 
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Object MAil-->

                                    <wssuc:InputFormSection ID="InputFormSection10" runat="server" Title="<%$Resources:vwf,label_object_mail %>" Description="<%$Resources:vwf,label_object_mail_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>       
    <ctr:Formula runat="server" ID="TextBox_Mail_Object" />
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <!--Body -->

                                    <wssuc:InputFormSection ID="InputFormSection11" runat="server" Title="<%$Resources:vwf,label_body_mail %>" Description="<%$Resources:vwf,label_body_mail_desc %>">
                                        <template_inputformcontrols><wssuc:InputFormControl runat="server" ><Template_Control>   
    <ctr:Formula runat="server" ID="TextBox_Mail_Body" />    
</Template_Control></wssuc:InputFormControl></template_inputformcontrols>
                                    </wssuc:InputFormSection>

                                    <wssuc:ButtonSection runat="server" ShowStandardCancelButton="false">
                                        <template_buttons>
                                                                <asp:PlaceHolder ID="PlaceHolder3" runat="server">               
                                                                  
                                                             <asp:Button OnClick="CreateMailStep_Click"  ID="CreateMailStepButton" ValidationGroup="CreateMailGroup" runat="server" class="ms-ButtonHeightWidth" Text="<%$Resources:wss,multipages_okbutton_text %>" />
                                                                </asp:PlaceHolder>
                                                             </template_buttons>
                                    </wssuc:ButtonSection>



                                </table>

                            </asp:View>
                        </asp:MultiView>


                    </tr>
                </table>
            </div>
        </tr>
    </table>
<asp:Label ForeColor="Red"  runat="server" Text="<%$Resources:vwf,error_no_step %>" Visible="false" ID="GlobalError" />

    <wssuc:ButtonSection runat="server" ShowStandardCancelButton="false">
        <template_buttons>
       <asp:PlaceHolder ID="PlaceHolder1" runat="server">               
         
    <asp:Button ID="AssociateWorkflow" runat="server" class="ms-ButtonHeightWidth" OnClick="AssociateWorkflow_Click" Text="<%$Resources:vwf,btn_associate_wf %>" />
    <asp:Button ID="Cancel" class="ms-ButtonHeightWidth" runat="server" Text="<%$Resources:wss,Workflow_Cancel %>" OnClick="Cancel_Click" />            
       </asp:PlaceHolder>
    </template_buttons>
    </wssuc:ButtonSection>


</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    <asp:Literal runat="server" Text="<%$Resources:vwf,title_association %>" />
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" runat="server" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea">
    <asp:Literal ID="Literal13" runat="server" Text="<%$Resources:vwf,title_association%>" />
</asp:Content>
